package com.young.springdemo.service.mediator;

//具体媒体类的子类
public class SubConcreateMediator extends ConcreateMediator {
    public Label label;//增加对label的引用


    @Override
    public void componentChanged(Compoment compoment) {
        if (compoment == button){
            System.out.println("----单击增加按钮----");
            list.update();
            comboBox.update();
            textBox.update();
            label.update();
        }else if (compoment == list){
            System.out.println("----从列表框选择内容----");
            comboBox.select();
            textBox.setText();
        }else if (compoment == comboBox){
            System.out.println("----组合框选择内容----");
            list.select();
            textBox.setText();
        }
    }

}
